/*  1:   */ package org.jetbrains.debugger;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.AsyncResult;
import com.intellij.openapi.util.AsyncValueLoaderManager;
import com.intellij.util.CommonProcessors.FindProcessor;
import com.intellij.util.Url;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */ 
/* 11:   */ public abstract class ScriptManagerBase<SCRIPT extends ScriptBase>
/* 12:   */   implements ScriptManager
/* 13:   */ {
/* 14:13 */   private final AsyncValueLoaderManager<ScriptBase, String> a = new AsyncValueLoaderManager(ScriptBase.class)
/* 15:   */   {
/* 16:   */     public void load(@NotNull ScriptBase paramAnonymousScriptBase, @NotNull AsyncResult<String> paramAnonymousAsyncResult)
/* 17:   */     {
/* 18:18 */       if (paramAnonymousScriptBase == null) {
/* 19:18 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase$1", "load" }));
/* 20:   */       }
/* 21:18 */       if (paramAnonymousAsyncResult == null) {
/* 22:18 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/debugger/ScriptManagerBase$1", "load" }));
/* 23:   */       }
/* 24:18 */       ScriptManagerBase.this.loadScriptSource(paramAnonymousScriptBase, paramAnonymousAsyncResult);
/* 25:   */     }
/* 26:   */   };
/* 27:   */   
/* 28:   */   protected abstract void loadScriptSource(SCRIPT paramSCRIPT, AsyncResult<String> paramAsyncResult);
/* 29:   */   
/* 30:   */   @NotNull
/* 31:   */   public AsyncResult<String> getSource(@NotNull Script paramScript)
/* 32:   */   {
/* 33:27 */     if (paramScript == null) {
/* 34:27 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase", "getSource" }));
/* 35:   */     }
/* 36:27 */     if (!containsScript(paramScript))
/* 37:   */     {
/* 38:28 */       AsyncResult tmp51_48 = AsyncResult.rejected();
/* 39:28 */       if (tmp51_48 == null) {
/* 40:28 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/debugger/ScriptManagerBase", "getSource" }));
/* 41:   */       }
/* 42:28 */       return tmp51_48;
/* 43:   */     }
/* 44:31 */     AsyncResult tmp97_94 = this.a.get((ScriptBase)paramScript);
/* 45:31 */     if (tmp97_94 == null) {
/* 46:31 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/debugger/ScriptManagerBase", "getSource" }));
/* 47:   */     }
/* 48:31 */     return tmp97_94;
/* 49:   */   }
/* 50:   */   
/* 51:   */   public boolean hasSource(Script paramScript)
/* 52:   */   {
/* 53:37 */     return this.a.has((ScriptBase)paramScript);
/* 54:   */   }
/* 55:   */   
/* 56:   */   public void setSource(@NotNull SCRIPT paramSCRIPT, @Nullable String paramString)
/* 57:   */   {
/* 58:41 */     if (paramSCRIPT == null) {
/* 59:41 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase", "setSource" }));
/* 60:   */     }
/* 61:41 */     this.a.set(paramSCRIPT, paramString);
/* 62:   */   }
/* 63:   */   
/* 64:   */   @Nullable
/* 65:   */   public ActionCallback getScriptSourceMapLoadCallback(@NotNull Script paramScript)
/* 66:   */   {
/* 67:47 */     if (paramScript == null) {
/* 68:47 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase", "getScriptSourceMapLoadCallback" }));
/* 69:   */     }
/* 70:47 */     return null;
/* 71:   */   }
/* 72:   */   
/* 73:   */   public Script forEachScript(@NotNull CommonProcessors.FindProcessor<Script> paramFindProcessor)
/* 74:   */   {
/* 75:52 */     if (paramFindProcessor == null) {
/* 76:52 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase", "forEachScript" }));
/* 77:   */     }
/* 78:52 */     forEachScript(paramFindProcessor);
/* 79:53 */     return (Script)paramFindProcessor.getFoundValue();
/* 80:   */   }
/* 81:   */   
/* 82:   */   public static boolean isSpecial(@NotNull Url paramUrl)
/* 83:   */   {
/* 84:57 */     if (paramUrl == null) {
/* 85:57 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/ScriptManagerBase", "isSpecial" }));
/* 86:   */     }
/* 87:57 */     return (!paramUrl.isInLocalFileSystem()) && ((paramUrl.getScheme() == null) || (paramUrl.getScheme().equals("vm")) || (paramUrl.getAuthority() == null));
/* 88:   */   }
/* 89:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.debugger.ScriptManagerBase

 * JD-Core Version:    0.7.0.1

 */